<!DOCTYPE html>
<script src="../../../resources/js-test.js"></script>
<div id=container>
  <div>
      <span></span>
  </div>
</div>
<script>
description('Appending an ancestor to a shadow tree should throw an exception');
var container = document.getElementById('container');
var span = container.querySelector('span');
var shadow = span.attachShadow({mode: 'open'});
var shadowDiv = shadow.appendChild(document.createElement('div'));
shouldThrow('shadowDiv.appendChild(container)');
</script>
